<template>
	<view class="">
		<u-navbar :border-bottom="false" :is-back="false" :title="banji" titleWidth='500'></u-navbar>
		<view class="container acea-row row-middle">
			<u-button class="btn line1" v-for="(item,index) in stuarr" :key="index" @click.stop="share(item.id)" >
				<view class="line1">
					{{item.name}}
				</view>
			</u-button>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				stuarr:[],
				banji:'作业'
			}
		},
		methods:{
			share(id){
				uni.navigateToMiniProgram({
				  appId: 'wx2bb41a49bedb222d',
				  path: 'pages/doHomeWork/doHomeWork?id='+id,
				  envVersion: 'develop',
				  success(res) {
					console.log(res)
				    // 打开成功
				  },
				  fail(err){
					console.log('share-err',err)
				  }
				})
			}
		},
		onLoad(e) {
			this.stuarr = JSON.parse(e.stuarr);
			this.banji = e.banji+'作业'
		}
	}
</script>

<style scoped>
	.container{
		width: 690rpx;
		margin: auto;
	}
	.btn{
		width: 210rpx;
		margin-right: 30rpx;
		margin-bottom: 30rpx;
	}
	.btn:nth-child(3n){
		margin-right: 0;
	}
</style>
